<template>
  <!-- <h1>主体</h1> -->
  <div class="main">
    <!-- 收集表单 -->
    <div class="ReleaseCollectionForm">
        <el-form label-position="right" label-width="80px" :model="formLabelAlign">
            <el-form-item label="藏品名称:">
                <el-input v-model="formLabelAlign.name"></el-input>
            </el-form-item>
            <el-form-item label="发行数量:">
                <el-input-number v-model="formLabelAlign.collections" :min="1" :max="1000" label="描述文字"></el-input-number>
            </el-form-item>
            <el-form-item label="发行单价:">
              <div class="issuesnum">
                <el-input v-model="formLabelAlign.appraisedvalue"></el-input>
              </div>
            </el-form-item>
        </el-form>
        <!-- 收集文件流 -->
        <el-upload
            class="upload-demo"
                ref="upload"
                :data="formLabelAlign"
                action="http://hatelys.vipgz1.91tunnel.com/operate/submitallasset"
                :headers="hd"
                :auto-upload="false">
                <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
                <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">点击发行藏品</el-button>
                <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
            </el-upload>          
    </div>
  </div>
</template>

<script>
export default {
    name:'frame',
    data() {
      return {
        formLabelAlign: {
          name: '',
          appraisedvalue: '',
          collections: 1,
          file:null,
        },
        labelPosition:'left',
        hd:{
            'Authorization':'Bearer '+localStorage.getItem('token')
        }
      };
    },
    methods:{
      handleUpload(file) {
            this.updata.file = file.raw          
        },
        submitUpload(){
          console.log("点击");
            this.$refs.upload.submit();
        }
    }
}
</script>

<style>
.ReleaseCollectionForm{
    width: 400px;
    height: 370px;
    margin: 20px auto;
    /* background-color: antiquewhite; */
}

.buchange{
  display: flex;
}
</style>